#ifndef GL_TEXTURE_MANAGER_H
#define GL_TEXTURE_MANAGER_H

#include "MWTextureManager.h"
#include "GLTexture.h"

namespace Myway {

	class GLTextureManager : public TextureManager
	{
		typedef HashMap<TString128, GLTexture*, TString128::hash_t>       Texture2DMap;

	public:
		GLTextureManager();
		~GLTextureManager();

		virtual TexturePtr CreateTexture(
			const TString128 & sName, int iWidth, int iHeight, int iMipLevel,
			PIXEL_FORMAT Format = PF_A8R8G8B8, USAGE usage = USAGE_STATIC);

		virtual TexturePtr LoadTexture(const TString128 & name, const TString128 & source, bool inFileSystem);
		virtual TexturePtr LoadTextureFromStream(const TString128 & name, DataStreamPtr stream);

		TexturePtr FindTexture(const TString128 & name);

		void DestroyTexture(Texture * pTexture);

	protected:
		Texture2DMap mTextures;
	};

}

#endif

